home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DJEMU106.ARJ / E22.CC < prev    next >
C/C++ Source or Header  |  1991-04-25  |  724b  |  44 lines

  1. #include "emu.h"
  2. #include "rmov.h"
  3. #include "compare.h"
  4.  
  5. void emu_22()
  6. {
  7.   if (empty())
  8.     return;
  9.   if (modrm > 0277)
  10.   {
  11.     emu_bad();
  12.   }
  13.   else
  14.   {
  15.     // ficom m32int
  16.     reg t;
  17.     r_mov((long *)get_modrm(), t);
  18.     int c = compare(st(), t);
  19.     int f;
  20.     if (c & COMP_NAN)
  21.     {
  22.       exception(EX_I);
  23.       f = SW_C3 | SW_C2 | SW_C0;
  24.     }
  25.     else
  26.       switch (c)
  27.       {
  28.         case COMP_A_LT_B:
  29.           f = SW_C0;
  30.           break;
  31.         case COMP_A_EQ_B:
  32.           f = SW_C3;
  33.           break;
  34.         case COMP_A_GT_B:
  35.           f = 0;
  36.           break;
  37.         case COMP_NOCOMP:
  38.           f = SW_C3 | SW_C2 | SW_C0;
  39.           break;
  40.       }
  41.     setcc(f);
  42.   }
  43. }
  44.